﻿using MaterialDesignThemes.Wpf;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using WpfLibrary;

namespace WpfLibraryTest
{
    /// <summary>
    /// MainWindow3.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow3 : Window
    {
        public MainWindow3()
        {
            InitializeComponent();
            this.DataContext = this;
        }
        public ObservableCollection<Account> Accounts { get; set; } = new ObservableCollection<Account>()
        {
            new Account() { AccountID = "1", Password = "123456" },
            new Account() { AccountID = "2", Password = "234567" },
            new Account() { AccountID = "3", Password = "345678" },
            new Account() { AccountID = "4", Password = "456789" },
        };
        public ObservableCollection<Account> Accounts2 { get; set; } = new ObservableCollection<Account>()
        {
            new Account() { AccountID = "5", Password = "abcdef" },
            new Account() { AccountID = "6", Password = "bcdefg" },
            new Account() { AccountID = "7", Password = "cdefgh" },
            new Account() { AccountID = "8", Password = "defghi" },
        };
        public ObservableCollection<Account> Accounts3 { get; set; } = new ObservableCollection<Account>()
        {
            new Account() { AccountID = "9", Password =  "ABCDEF" },
            new Account() { AccountID = "10", Password = "BCDEFG" },
            new Account() { AccountID = "11", Password = "CDEFGH" },
            new Account() { AccountID = "12", Password = "DEFGHI" },
        };

        private PaletteWindow? PaletteWindow { get; set; }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            PaletteWindow ??= new PaletteWindow();
            PaletteWindow.Show();
        }
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (PaletteWindow != null)
            {
                PaletteWindow.ShouldClose = true;
                PaletteWindow.Close();
            }
        }
    }
}
